<template>
  <div class="boxs">
    <div class="right">
      <div class="right-middle">
        <h4>分类</h4>
        <div class="right-cata" v-for="item in cata" :key="item.id">
          <div class="el-icon-folder-opened cata-content">{{ item.name }}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      cata: {},
    };
  },
  created() {
    this.getCategories();
  },
  methods: {
    async getCategories() {
      let res = await this.$axios.post("/api/category/list");
      this.cata = res.data.data;
    },
  },
};
</script>

<style scoped>
.boxs {
  width: 100%;
  height: auto;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
    
}
.right {
  width: 285px;

}
.right-middle {
  width: 100%;
  margin-bottom: 15px; /* 底部15px间距 */
  background-color: #fff; /* 浅灰背景 */
  line-height: 30px;
  font-size: 18px;
  border-radius: 15px;
  padding:20px;
  margin-left: -18px;
  
}
.cata-conten {
  border-radius: 15px;
}
.right-middle div:hover {
  cursor: pointer;
  background-color: #909090;
  border-radius: 8px;
  color: aqua;
}
</style>